﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="tm_buyRequestList.ascx.cs" Inherits="controls_buyRequestList" %>
<center>
    <asp:Panel ID="pnlSearchResult" runat="server" Width="100%">
        <table width="100%">
            <tr>
                <td style="height: 21px">
                                    </td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="gvItemList" runat="server" AllowPaging="True" AllowSorting="True"
                        AutoGenerateColumns="False" DataKeyNames="requestId" OnPageIndexChanging="gvItemList_PageIndexChanging" Width="100%" CssClass="table" OnSorting="gvItemList_Sorting">
                        <Columns>
                            <asp:TemplateField>
                                <ItemStyle HorizontalAlign="Left" Width="3%" />
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkItem" runat="server" />
                                    <asp:Label ID="lblRequestId" runat="server" Text='<%# Eval("requestId") %>' Visible="False"></asp:Label>
                                    <asp:Label ID="lblBuyerId" runat="server" Text='<%# Eval("buyerId") %>' Visible="False"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="T&#236;m mua" SortExpression="name">
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" />
                                <ItemTemplate>
                                    <asp:HyperLink ID="hplRequestName" runat="server" NavigateUrl='<%# GetBuyRequestURL(DataBinder.Eval(Container, "DataItem.requestId").ToString()) %>'
                                        Text='<%# Eval("name") %>'></asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Đơn vị" SortExpression="buyerName">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("buyerName") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:HyperLink ID="hplBuyerName" runat="server" NavigateUrl='<%# GetUserURL(DataBinder.Eval(Container, "DataItem.buyerId").ToString()) %>'
                                        Text='<%# Eval("buyerName") %>'></asp:HyperLink>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="registerDate" DataFormatString="{0:d}" HeaderText="Ng&#224;y"
                                SortExpression="registerDate">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle Width="8%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="lastModifyDate" DataFormatString="{0:d}" HeaderText="Cập nhật"
                                SortExpression="lastModifyDate" Visible="False">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle Width="8%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="expireDate" DataFormatString="{0:d}" HeaderText="Hết hạn"
                                SortExpression="expireDate" Visible="False">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle Width="8%" />
                            </asp:BoundField>
                            <asp:BoundField DataField="status" HeaderText="Trạng th&#225;i" SortExpression="status" Visible="False">
                                <ItemStyle HorizontalAlign="Center" Width="10%" />
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:BoundField>
                            <asp:TemplateField>
                                <ItemStyle HorizontalAlign="Center" Width="3%" />
                                <ItemTemplate>
                                    <asp:HyperLink ID="hplContact" runat="server" ImageUrl="~/images/icon_bulkmail_16px.gif" NavigateUrl='<%# GetContactLink(DataBinder.Eval(Container, "DataItem.buyerId").ToString(),DataBinder.Eval(Container, "DataItem.requestId").ToString()) %>'>HyperLink</asp:HyperLink>
                                </ItemTemplate>
                            
                            </asp:TemplateField>
                        </Columns>
                        <PagerSettings Mode="NumericFirstLast" />
                        <PagerStyle HorizontalAlign="Right" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Panel ID="pnlBottom" runat="server" Width="100%">
                        <table width="100%">
                            <tr>
                                <td style="width: 50%">
                                    <asp:CheckBox ID="chkCheckAll" runat="server" AutoPostBack="True" 
                                        OnCheckedChanged="chkCheckAll_CheckedChanged" CssClass="titleText3" 
                                        Text="Chọn tất cả" /></td>
                                <td align="right">
                                </td>
                            </tr>
                            <tr>
                                <td align="center" colspan="2">
                                    <asp:Label ID="lblMessage" runat="server" CssClass="titletext2"></asp:Label></td>
                            </tr>
                            <tr>
                                <td style="width: 50%">
                                    <asp:Label ID="lblStatus" runat="server"  Text="Trạng thái :" CssClass="titletext2"></asp:Label><asp:DropDownList
                                        ID="cbStatus" runat="server">
                                    </asp:DropDownList><asp:Button ID="btnProcessSelected" runat="server" Font-Bold="True"
                                        OnClick="btnProcessSelected_Click" Text="Aggree" CssClass="btn" /></td>
                                <td align="right">
                                    <asp:Button ID="btnDelete" runat="server" Font-Bold="True"
                                        OnClick="btnDelete_Click" Text="Xóa chọn" CssClass="btn" Visible="False" />
                                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                    <asp:Button ID="btnExport" runat="server" Font-Bold="True" Text="Excel" CssClass="btn" OnClick="btnExport_Click" />
                                    </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Label ID="lblDebugMessage" runat="server"></asp:Label></center>
